home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_c / cuj0696.zip / DWYER.ZIP / QFLOAT / CALC100.DOC next >
Text File  |  1995-07-19  |  4KB  |  108 lines

  1.         CALC100 version 1.2
  2.  
  3.    CALC100 is a 100 digit calculator program. It can do
  4. arithmetic, Fortran-style algebraic syntax, and various
  5. built-in mathematical functions.  Its fast floating
  6. point arithmetic takes advantage of the computer's unsigned
  7. integer multiply and divide instructions.  Division uses
  8. a Newton-Raphson iteration, which is much faster than
  9. the shift-and-subtract approach.
  10.  
  11.    Algebraic expressions are entered in the same syntax as
  12. Fortran or other high level language statements.  Multiple
  13. statements can be entered on the same line but must be separated
  14. by semicolons.  Thus the entry 'x=2; y=x+4' sets the variables
  15. x and y as indicated and also displays the numeric results.
  16. There are 7 algebraic variables named t, u, v, w, x, y, and z.
  17. The constant pi is also represented as a variable.
  18.  
  19.    All of calc100's commands have the syntax of C language
  20. functions. For example, to display the logarithm of 2, you may
  21. enter the command 'log(2)' followed by a carriage return.  The
  22. parentheses may be omitted if there is no ambiguity; thus 'log 2'
  23. gives the same result.
  24.  
  25. acos        Radian inverse circular cosine
  26. acosh        Inverse hyperbolic cosine
  27. asin        Radian inverse circular sine
  28. asinh        Inverse hyperbolic sine
  29. atan        Radian inverse circular tangent
  30. atanh        Inverse hyperbolic tangent
  31. bits        Display floating point number as array of integers
  32. cbrt        Cube root
  33. cos        Circular radian cosine
  34. cosh        Hyperbolic cosine
  35. cot        Circular radian cotangent
  36. digits N    Set number of digits in the numeric display to N
  37. dm        Define macro command (see text below)
  38. em N        Execute macro N times
  39. exit        Terminate program - use at end of command files
  40. exp        Base e exponential function
  41. fac        Factorial of integer argument
  42. gamma        Gamma function (accuracy >= 55 decimals)
  43. h or help    Display list of commands
  44. hex        Display integer argument in radix 8, 10, and 16
  45. jv(v,x)        Bessel function Jv(x) (accuracy about 40 decimals)
  46. log        Natural logarithm
  47. pow(x,y)    exp( y log x ) = x raised to the yth power
  48. save filename    Save session in file 'filename'
  49.             or in 'calc.sav' if no file name given
  50. sin        Circular radian sine
  51. sinh        Hyperbolic sine
  52. sqrt        Square root
  53. system command    Execute operating system 'command' and return
  54. take filename    Read commands from indicated disc file
  55. tan        Circular radian tangent
  56. tanh        Hyperbolic tangent
  57. tm        Type (display) currently defined macro command
  58. yn(n,x)        Bessel function Yn(x) (accuracy about 40 decimals)
  59.  
  60.    To define a macro expression, enter 'dm' and type the
  61. expression on the next line.  The expression must fit on
  62. one line, but multiple statements can be entered if they
  63. are separated by a semicolon (;).  Execute the defined
  64. macro N times by the command 'em N'.  Display the current
  65. macro definition by 'tm'.  Example:
  66.  
  67. x=y=v=z=1
  68. dm
  69. z=z*x/v; v=v+1; y=y+z
  70. em 10
  71.  
  72. is a power series for exp(1).  You can put the above into
  73. an ASCII file named, say, sample.tak and execute the program
  74. from the file by the command 'take sample.tak'.
  75.  
  76.     You can also redirect input or output, for example: 'calc
  77. <sample.tak >answer.dat'.  But in that case there shoud be an
  78. 'exit' command at the end of the input file.
  79.  
  80.     The 'system' command passes the rest of the command line
  81. to the computer's operating system to execute as a command.
  82. After the command has finished executing, control will return
  83. to the calc100 program.
  84.  
  85.     The 'save' command starts logging most of what appears
  86. on the screen into a disc file.  Certain error printouts and
  87. the help menus will not be written into the file.  A repeated
  88. invocation of 'save' closes the old save file and opens a new one
  89. (or possibly the same one if the file name argument is the same).
  90. Printout generated by a 'system' command will not go into the
  91. save file, but it probably will go into a file that was created by
  92. redirecting the standard output as in 'calc <sample.tak >answer.dat'.
  93.  
  94.     The rigorous way of calling a function is to put the
  95. argument in parentheses.  However if no expression decoding
  96. is implied, the parentheses can be omitted.  For example
  97. 2 + sin x means 2 + sin(x), but sin x + 2 means sin(x) + 2.
  98. If a function has more than one argument, the parentheses
  99. must be there.  For example pow(2,3) is 8, but pow 2,3 is
  100. an error.
  101.  
  102.    By default, the numeric display gives 70 digits after the
  103. decimal point.  This may be varied from N = 1 to 99 digits by
  104. the command 'digits N'.
  105.  
  106. -- Steve Moshier
  107.   September, 1988
  108.